package Demo.Interfaces;

import Demo.Interfaces.Person;

/**
 * @className: Demo3
 * @author: 芃
 * @description: Cloneable接口测试
 * @date: 2023/8/17 12:11
 */
public class Demo3 {
    //深拷贝和浅拷贝看具体的拷贝方式而定

    public static void main(String[] args) throws CloneNotSupportedException {
        Person person = new Person(18,"张三","男");
        Person person1 = (Person) person.clone();
        person1.age = 88;
        System.out.println(person);
        System.out.println(person1);
    }
}
